import React, {useContext, useEffect} from "react"
// Taro 额外添加的 hooks 要从 '@tarojs/taro' 中引入
import {useDidShow, useDidHide, useLoad} from "@tarojs/taro"
// 全局样式
import {Provider} from "mobx-react"
import appStore from "@/store/app"
import "windi.css"
import "./mini.scss"
import "./app.scss"
import "./css/iconfont.css"
import "taro-ui/dist/style/index.scss"

const App: React.FC = ({children}): JSX.Element => {
	const {login} = useContext(appStore)
	useEffect(() => {
		login()
	}, [])

	// 对应 onShow
	useDidShow(() => {})

	// 对应 onHide
	useDidHide(() => {})

	// 对应onLoad
	useLoad(() => {})

	return <Provider>{children}</Provider>
}

export default App
